class Solution {
public:
    void push(int value) {
   		s1.push(value);
   		if(s2.empty())
   			s2.push(value);
   		else
   		{
   			int val = s2.top();
   			if(val < value)
   				s2.push(val);
   			else
   				s2.push(value);
   		}
    }
    void pop() {
        if(!s1.empty())
        {
        	s1.pop();
        	s2.pop();
        }
    }
    int top() {
        return s1.top();
    }
    int min() {
        return s2.top();
    }
private:
    stack<int> s1,s2;
};